#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

struct tree_node {
	struct tree_node *parent, *left, *right;
	int	value;
	char	operation;
}

const char operations[] = { '+', '-', '*', '/' };

struct tree_node *
build_eval_tree(char *s)
{
	int i;
	char *op_ptr = NULL;
	char *num_ptr = NULL;
	struct tree_node *root, *relroot, *node;
	int value;

	for (i = 0; i < 4; ++i) {
		op_ptr = strchr(s, operations[i]);
		if (op_ptr != NULL && op_ptr < strchr(s, '('))
			break;
	}
	if (*op_ptr == '+' || *op_ptr == '-' || op_ptr == '*' ||
			op_ptr == '/') {
		node = calloc(1UL, sizeof *node);
		node.operation = *op_ptr;
		node.value = 0;
		node.parent = parent;
		parent = node;
	} else {
		ASSERT(parent.value == 0 && parent.operation != '\0');

		; // /kill
	}
	return NULL; //FIXME
}

int
main(void)
{
	char input[1000];
}
